import time
import datetime
from functools import wraps
def time_now():
    return time_now()
def timestamp():#时间戳

    return time.time()
def dt_strftime(fmt='%Y&m'):
    """
    datetime格式化时间
    :param fmt "%Y%m%d %H%M%S
    """
    return datetime.datetime.now().strftime(fmt)
def sleep(seconds=1.0):
    #睡眠时间
    time.sleep(seconds)
def running_time(func): #函数运行时间
    @wraps(func)
    def wrapper(*args,**kwargs):
        start=timestamp()
        res=func(*args,**kwargs)
        print('检验元素完成！用时%.3f秒'%(timestamp()-start))
        return res
    return wrapper
if __name__ == '__main__':
    @running_time
    def aaaaa():
        print(dt_strftime('%Y%m%d$H%H%S'))
    print(aaaaa.__doc__,aaaaa.__name__)
    aaaaa()